package us.cirion.adventure.engine.result;

import us.cirion.adventure.engine.GameDisplay;
import us.cirion.adventure.engine.Result;

/**
 * SaveGame orders the user interface to save the player's current progress in
 * the game. The actual saving of the game will most likely happen through
 * {@link us.cirion.adventure.engine.Game#writeObject(java.io.DataOutputStream)},
 * but the display is responsible for any user interface involved in the save
 * game process. This may include a message to the user, the ability to enter a
 * filename, selection from a menu of save game slots, etc.
 * 
 * @author Chris
 */
public class SaveGame implements Result
{

	private GameDisplay gameDisplay;

	/**
	 * Constructs a new command to save the game.
	 * 
	 * @param gameDisplay The user interface responsible for executing the save
	 *            game command.
	 */
	public SaveGame(GameDisplay gameDisplay)
	{
		this.gameDisplay = gameDisplay;
	}

	/**
	 * Saves the game.
	 */
	public void execute()
	{
		gameDisplay.saveGame();
	}

}
